package com.wyvoid.forum.service;

import com.wyvoid.forum.domain.Post;
import com.wyvoid.forum.domain.Topic;
import com.wyvoid.forum.web.search.SearchBean;
import com.wyvoid.core.persistent.Pagination;
import com.wyvoid.core.persistent.hibernate.HibernatePage;
import org.springframework.transaction.annotation.Transactional;


/**
 * 贴子模块业务处理接口
 * 
 * @author 51void
 * @link www.51void.com
 */
@Transactional
public interface IPostService {

	/**
	 * 根据主题批量删除帖子
	 * 
	 * @param topicId 主题编号
	 */
	public void deletePosts(int topicId) ;
	

	/**
	 * 列表全部的帖子
	 * 
	 * @param topicId 主题编号
	 * @param pagination 分页参数
	 * @return HibernatePage 帖子集合
	 */
	public HibernatePage<Post> getPosts(final long topicId, final Pagination pagination)  ;

	/**
	 * 取得贴子总数
	 * @return 贴子总数
	 */
	public long countPost() ;

    void newTopic(Topic topic, Post post);

    void replyTopic(Post post);

    Post getPost(long postId);

    void updatePost(Post tempPost);

    HibernatePage<Post> searchPosts(SearchBean searchBean, Pagination pagination);
}
